home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / misc / temgen.lha / Temgen / tg-0.11 / frame.c < prev    next >
C/C++ Source or Header  |  2002-12-18  |  445b  |  25 lines

  1. #include "frame.h"
  2. #include "omani.h"
  3.  
  4. static int _next_free = 1;
  5.  
  6. int frame_alloc( int Frames )
  7. {
  8.     int res;
  9.     
  10.     /* FIXME ! - better memory allocation ! */
  11.     res = ob_item( Frames, _next_free++ );
  12.     return res;
  13. }
  14.  
  15. void frame_free( int Frames, int obj )
  16. {
  17.     int last;
  18.     
  19.     /* FIXME ! - better deallocation */
  20.     ob_set( obj, 'i', 0 );
  21.     last = ob_item( Frames, _next_free-1 );
  22.     if ( last == obj ) 
  23.         _next_free--;
  24. }
  25.